package com.yanyeori.webtest.util;

import lombok.extern.slf4j.Slf4j;

/**
 * 发送邮件工具
 *
 * @author chenkuan
 * @since 2022/6/22
 */
@Slf4j
//@Component
public class SendMailUtil {
/*
    private final JavaMailSender javaMailSender;
    private final MailProperties mailProperties;

    public SendMailUtil(JavaMailSender javaMailSender, MailProperties mailProperties) {
        this.javaMailSender = javaMailSender;
        this.mailProperties = mailProperties;
    }

    *//**
     * 发送邮件
     *
     * @param nickname 发送昵称
     * @param to       收件人
     * @param cc       抄送人
     * @param subject  主题
     * @param content  内容
     *//*
    public void sendSimpleMail(String nickname, String[] to, String[] cc, String subject, String content) {
        String from = mailProperties.getUsername();
        //创建SimpleMailMessage对象
        SimpleMailMessage message = new SimpleMailMessage();
        //邮件发送人
        message.setFrom(nickname == null ? from : nickname + '<' + from + '>');
        //邮件接收人
        message.setTo(to);
        //邮件抄送人
        message.setCc(cc);
        //邮件主题
        message.setSubject(subject);
        //邮件内容
        message.setText(content);
        //发送邮件
        javaMailSender.send(message);
        log.info("The mail has been sent.");
    }*/
}
